******************
*Code to Replicate:
*Parinandi, Srinivas and Matthew P. Hitt. 2018.
*"How Politics Influences the Energy Pricing Decisions of Elected Public Utilities Commissioners."
*Energy Policy, 118: 77-87.
*If you use these data, please cite the original article in Energy Policy
******************

*Use "parinandi_hitt_energy_policy_replication_data.dta"

*Note: The estimates shown in the paper were obtained using Stata 15.1 SE, 
*on a desktop computer running Windows 7 Professional 


*Table 1 

reg dvSTD republicanadvantage customerslog consumerlog industrytestdiff ///
igtestdiff proximity changeunemp changeinflation, robust

*Figure 1

margins, at(changeinflation = (-1.05(1.11)3.39)) atmeans
marginsplot


*Figure 2

margins, at(consumerlog = (0(1.118)4.58)) atmeans
marginsplot 


***************
*Appendix
***************

*Table A1, Column 1 (daily rate dummy) 

reg dvSTD daily republicanadvantage customerslog consumerlog industrytestdiff ///
igtestdiff proximity changeunemp changeinflation, robust


*Table A1, Column 2 (firm-clustered errors) 

reg dvSTD republicanadvantage customerslog consumerlog industrytestdiff ///
igtestdiff proximity changeunemp changeinflation, cluster(firm)


*Table A2, Column 1 (proposals only)

reg proposalSTD republicanadvantage customerslog consumerlog industrytestdiff ///
igtestdiff proximity changeunemp changeinflation, robust

*Table A2, Column 1 (decisions only)

reg decisionSTD republicanadvantage customerslog consumerlog industrytestdiff ///
igtestdiff proximity changeunemp changeinflation, robust


*Table A3, Column 1 (interaction of party composition and inflation)

reg dvSTD c.republicanadvantage#c.changeinf republicanadvantage customersLog consumerLog ///
industryTestDiff igTestDiff proximity changeunemp changeinflation, cluster(decisionyr)

*Table A4, Column 1 (year fixed effects)

reg dvSTD republicanadvantage customersLog consumerLog industryTestDiff igTestDiff /// 
proximity changeunemp changeinflation i.decisionyr, robust

*Table A4, Column 2 (year-clustered errors)

reg dvSTD republicanadvantage customersLog consumerLog industryTestDiff igTestDiff /// 
proximity changeunemp changeinflation, cluster(decisionyr)

*Table A4, Column 3 (commission fixed effects) 

reg dvSTD republicanadvantage customersLog consumerLog industryTestDiff igTestDiff /// 
proximity changeunemp changeinflation i.commission, robust

*Table A4, Column 4 (commission-clustered errors) 

reg dvSTD republicanadvantage customersLog consumerLog industryTestDiff igTestDiff /// 
proximity changeunemp changeinflation, cluster(commission)
